package Adventure;

import java.util.ArrayList;

public class Weapon extends GameObject
{
	private int ammoCapacity = 0;
	private int totalAmmo = 0;
	private String weaponType = "";
	private ArrayList<Projectile> bullets;
	
	public Weapon(String _name, String _type, int _ammo)
	{
		super(_name, true);
		totalAmmo += _ammo;
		weaponType = _type;
		
		bullets = new ArrayList<Projectile>();
	}

	public int getAmmoCapacity()
	{
		return ammoCapacity;
	}

	public void setAmmoCapacity(int _ammoCapacity) 
	{
		ammoCapacity = _ammoCapacity;
	}
	
	public void addAmmoToWeapon(int _ammo)
	{
		totalAmmo += _ammo;
	}

	public int getTotalAmmo() 
	{
		return totalAmmo;
	}

	public void setTotalAmmo(int _totalAmmo) 
	{
		totalAmmo = _totalAmmo;
	}

	public String getWeaponType() 
	{
		return weaponType;
	}

	public void setWeaponType(String _weaponType) 
	{
		weaponType = _weaponType;
	}
	
	public void reloadWeapon()
	{
		for(int i = 0; i < totalAmmo; i++)
		{
			bullets.add(new Projectile("RegularBullet", 3, 3.0f));
		}
	}
	
	public void shootWeapon()
	{
		bullets.remove(bullets.size()-1);
	}
	
	
	
}
